@echo off
  set REL=_Release
  set GNU=%REL%\gnu.exe
  set U32=C:\U
  set U64=C:\U\64

  set gnus=true false cp mv rm touch uuidgen sleep who uptime tr cmp ln basename dirname pathname pwd cat streams
  rem  echo mkdir
  set unames=arch logname
  rem  hostname username whoami
  set printfs=seq

  set S32=%REL%\gnu.exe %REL%\uname.exe %REL%\printf.exe
  rem  make\%REL%\make.exe sed\%REL%\sed.exe re2c\%REL%\win32\re2c.exe
  set S64=%REL%\win64\gnu.exe %REL%\win64\uname.exe %REL%\win64\printf.exe
  rem  make\%REL%\win64\make.exe sed\%REL%\win64\sed.exe re2c\%REL%\win64\re2c.exe
  set a3264=gnu printf
  rem  make gmake

  set op=inst& set t=%~1
  for %%u in (u /u -u un) do if /i "%%u" == "%t:~0,2%" set op=uninst

  call :%op%_all %U32% 32 "%S32%"
  if /i "%PROCESSOR_ARCHITECTURE%" == "AMD64" call :%op%_all %U64% 64 "%S64%"
goto :EOF

:inst_all
  if not exist %1 call :run md "%~1"
  call :run %GNU% cp -pf %~3 "%~1\"
  call :set_aliases %1 gnu "%gnus%"
  call :set_aliases %1 uname "%unames%"
  call :set_aliases %1 printf "%printfs%"
  rem call :run %GNU% ln -hf %1\make.exe %1\gmake.exe
  for %%n in (%a3264%) do call :run %GNU% ln -hf %1\%%n.exe %1\%%n%2.exe
goto :EOF

:set_aliases
  for %%n in (%~3) do call :run %GNU% ln -hf %1\%2.exe %1\%%n.exe
goto :EOF

:uninst_all
  setlocal enabledelayedexpansion
  set list=
  set L=gnu gnu%2 %gnus% uname %unames% printf printf%2 %printfs%
  rem  make make%2 gmake gmake%2 re2c
  for %%n in (%L%) do if exist %~1\%%n.exe set list=!list! "%~1\%%n.exe"
  if not "" == "!list!" call :run %GNU% rm -f !list:~1!
  endlocal
goto :EOF

:run
  set cmd=%*
  echo %cmd%
  %cmd%
goto :EOF
